/**
 * 
 */
package propertyEditor;

import java.beans.PropertyEditorSupport;

/**
 * @author Andrei Iordache
 *
 */
public class IntegerPropertyEditor extends PropertyEditorSupport{
	
	@Override
	public String getAsText() {
		return String.valueOf(getValue());
	}

	@Override
	public void setAsText(String text) throws IllegalArgumentException {
		try {
			int value = Integer.parseInt(text);
			setValue(value);
		}catch (Exception e) {
			e.printStackTrace();
		}
	}

}
